#pragma once

#include <OIS.h>
#include <Ogre.h>
#include <vector>
#include <string>
#include "input.h"
#include "utils.h"

using namespace Ogre;
using namespace std;

class Spaceship
{
public:
	Spaceship(string name, string spaceshipModel, SceneManager *sceneMgr);
	virtual ~Spaceship();
	
	virtual Vector3 getSpeed();
	virtual void setSpeed(Vector3 vector);
	virtual Vector3 getAcceleration();
	virtual void setAcceleration(Vector3 vector);
	virtual void doPhysics();
protected:
	virtual void initialize();
	virtual void setupScene(string name, string spaceshipModel);
protected:
	Utils::Vector3 mSpeed, mAcceleration; // en unidades de ogre
	Utils::Vector3 mRotationSpeed, mRotationAcceleration; // en radianes
	SceneNode *mSpaceshipNode;
	SceneManager *mSceneMgr;
	Entity *mSpaceshipEntity;
	float	maxRotationAcceleration, maxAcceleration;
	float	maxRotationSpeed, maxSpeed;
};

class MySpaceship : public Spaceship
{
public:
	MySpaceship(string name, string spaceshipModel, SceneManager *sceneMgr);
	virtual void doActions(vector<Action> currentEvents);
	static void updateSpeedDisplay(void *spaceship);
	void updateSpeedDisplay();
	Camera* getCamera();
protected:
	virtual void initialize();
	virtual void setupScene(string name, string spaceshipModel);
protected:
	Camera *mCamera; /// Cámara desde la que vemos la escena
	SceneNode *mCameraNode, *mShieldNode; /// Nodo del que depende la cámara
	Entity *mShieldEntity;
	
	
};
